package com.fintech.third.service.moxie;

import com.fintech.third.model.moxie.bank.BankBill;
import com.fintech.third.model.moxie.bank.BankBillShoppingSheetList;
import com.fintech.third.model.moxie.bank.BankCardInfo;
import com.fintech.third.model.moxie.bank.BankInstallmentList;
import com.fintech.third.model.moxie.bank.TimeDeposit;
import com.fintech.third.service.moxie.task.TaskCreateReq;
import com.fintech.third.service.moxie.task.TaskCreateRsp;
import com.fintech.third.service.moxie.task.TaskStatusRsp;
import com.fintech.third.service.moxie.task.TaskVoidRsp;
import com.fintech.third.service.moxie.task.UserInput;

import retrofit2.Call;
import retrofit2.http.Body;
import retrofit2.http.GET;
import retrofit2.http.POST;
import retrofit2.http.Path;

/**
 * 网银
 */
public interface BankApi {
    /**
     * 创建任务
     *
     * @param req
     * @return
     */
    @POST("/bank/v2/tasks")
    Call<TaskCreateRsp> createTask(@Body TaskCreateReq req);

    /**
     * 查询任务状态
     *
     * @param taskId
     * @return
     */
    @GET("/bank/v2/tasks/{taskid}/status")
    Call<TaskStatusRsp> getTaskStatus(@Path("taskid") String taskId);

    /**
     * 输入验证码
     *
     * @param taskId
     * @param input
     * @return
     */
    @POST("/bank/v2/tasks/{taskid}/input")
    Call<TaskVoidRsp> input(@Path("taskid") String taskId, @Body UserInput input);

    /**
     * 查询卡信息
     *
     * @param cardId
     * @return
     */
    @GET("/bank/v2/cards/{cardid}/basic")
    Call<BankCardInfo> getCardInfo(@Path("cardid") String cardId);

    /**
     * 查询定期存款
     *
     * @param cardId
     * @return
     */
    @GET("/bank/v2/cards/{cardid}/time-deposit")
    Call<TimeDeposit> getTimeDeposit(@Path("cardid") String cardId);

    /**
     * 查询账单信息
     *
     * @param billId
     * @return
     */
    @GET("/bank/v2/bills/{billid}")
    Call<BankBill> getBillInfo(@Path("billid") String billId);

    /**
     * 查询账单流水
     *
     * @param billId
     * @return
     */
    @GET("/bank/v2/bills/{billid}/expense-records")
    Call<BankBillShoppingSheetList> getBillRecords(@Path("billid") String billId);

    /**
     * 查询分期信息
     *
     * @param billId
     * @return
     */
    @GET("/bank/v2/bills/{billid}/installment-records")
    Call<BankInstallmentList> getInstallmentRecords(@Path("billid") String billId);
}
